-
Notifications
You must be signed in to change notification settings - Fork 8k
Remove unreachable code after zend_error_noreturn calls. #20983
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Remove unreachable code after zend_error_noreturn calls. #20983
Conversation
iluuu1994
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No strong opinion, some compilers do not understand ZEND_NORETURN and thus may fail with strange errors in some cases. Also, you missed a few similar instances. This regex may help. zend_error_noreturn\([^)]*\);\n\s*[^}\s]
Thank @iluuu1994 for the feedback. I noticed the codebase already has instances where Regarding the remaining instances from your regex, Would you prefer that I:
Happy to adjust based on your guidance. |
|
Fair enough. Please adjust the remaining cases then. |
|
That code was kept to avoid "warning: control reaches end of non-void function" on Windows. |
Thanks @dstogov for the feedback, makes sense. I’m on macOS, so I didn’t hit that. Is this MSVC C4715? I’d like to reproduce locally / confirm via CI |
Description
zend_error_noreturn() never returns (marked with ZEND_NORETURN), so any code following it is dead code that can never be executed.